<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/10/16
 * Time: 18:53
 */

class DB
{
    private static $_instance=null;
    private  function  __construct()
    {

    }
    static function getObj()
    {
        if(is_null(self::$_instance))
        {
            self::$_instance=new self();
        }
        return self::$_instance;
    }


}
Var_dump(DB::getObj());
Var_dump(DB::getObj());